#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<assert.h>
#include<string.h>

char* my_strncat(char* des, char* src, size_t num) {
	assert(des && src);
	char* reg = des;

	while (*reg++);
	reg--;

	for (int i = 0; i < num&&src!='\0'; i++) {
		*reg = *src;
		reg++;
		src++;
	}
	*reg = '\0';

return des;
}


int  main()
{
	char des[20] = { "hello \0xxxxxxxxxxx" };
	char src[] = { "world" };

	my_strncat(des, src, strlen(src));

	printf("%s\n", des);

	return 0;
}